package com.jeenms.test.jvm;

public class StackDemo {

	public static void main(String[] args) {
		System.out.println(Runtime.getRuntime().maxMemory()/1024/1024.0);
		byte[] byteArray1 = new byte[1024*1024*1024*1];//1G
		System.out.println(byteArray1.length);
		System.out.println(Runtime.getRuntime().maxMemory()/1024/1024.0);
		byte[] byteArray2 = new byte[1024*1024*1024*1];//1G
		byte[] byteArray3 = new byte[1024*1024*1024*1];//1G
//		byte[] byteArray4 = new byte[1024*1024*1024*1];//1G
//		byte[] byteArray5 = new byte[1024*1024*1024*1];//1G
//		byte[] byteArray6 = new byte[1024*1024*1024*1];//1G
//		byte[] byteArray7 = new byte[1024*1024*1024*1];//1G
		System.out.println(Runtime.getRuntime().maxMemory()/1024/1024.0);
		try {
			Thread.sleep(100000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
